import request from '../../utils/request'


/**
 * 增加黑名单
 * @param params
 * @returns {Promise.<void>}
 */
export async function addBlacklist({cstId, memo}) {
    return request(apiPath.imagent + "/api/blacklist", {
        method: 'post',
        data: {cstId, memo}
    });
}

/**
 * 移除黑名单
 * @param id
 * @returns {Promise.<void>}
 */
export async function deleteBlacklist({id}) {
    return request(apiPath.imagent + "/api/blacklist/" + id, {
        method: 'delete'
    });
}

/**
 * 分页获取黑名单
 * @param cstId
 * @param page
 * @returns {Promise.<void>}
 */
export async function getListForPage({customerno, cstName, beginTime, endTime,   page}) {
    return request(apiPath.imagent + "/api/blacklists", {
        method: 'get',
        data: {customerno, cstName, beginTime, endTime, page: page.page, size: page.size}
    });
}



